import <BatBrain.ash>

record plan {
	record {
		record {
			spread low;
			spread high;	// Not currently in use
		} [int] options;
	} [int] rounds;
};

float worstCaseTotal(plan p) {
	float worstCase; 
	int numRounds = count(p.rounds);
	foreach round in p.rounds {
		int numOptions = count(p.rounds[round].options);
		float worstOption = 999999999999999999999;		// can't find a max float constant, too lazy to read java specs
		foreach option in p.rounds[round].options {
			float thisOption = dmg_dealt(p.rounds[round].options[option]);
			if (min(worstOption, thisOption) = thisOption) {
				worstOption = thisOption;
			}
		}
		worstCase = worstCase + worstOption;
	}
	return worstCase;
};